﻿namespace AgileBoard.Infrastructure.Data.Repositories
{
    using System;
    using System.Collections.Generic;
    using Domain;
    using Domain.DataInterfaces;
    using SharpArch.Data.NHibernate;

    public class ReleaseRepository : Repository<Release>, IReleaseRepository
    {

        public IList<Release> FindByProject(Guid projectId)
        {
            return Session.CreateQuery("from Release where ProjectID = :projectId order by PeriodFrom")
                .SetParameter("projectId", projectId)
                .List<Release>();
        }

        public Release Save(Release entity)
        {
            return (Release) Session.Save(entity);
        }
    }
}